package com.aliyun.messagemgt.domain.repository;

import com.aliyun.messagemgt.common.dto.send.PushChannelInfo;
import com.aliyun.messagemgt.dto.PushChannelAdd;
import com.aliyun.messagemgt.dto.PushChannelList;
import com.aliyun.messagemgt.dto.query.PushChannelQuery;

import java.util.List;
import java.util.Set;

/**
 * @Description
 * @Author hzw
 * @Date 2020/12/16 10:57
 * @Version 1.0
 */
public interface PushChannelRepository {
    /**
     * 通过描述查询推送渠道
     *
     * @param
     * @return
     */
    int selectByDescription(PushChannelAdd pushChannelAdd);

    /**
     * 插入推送渠道
     *
     * @param pushChannelAdd
     * @return
     */
    int insertPushChannel(PushChannelAdd pushChannelAdd);

    /**
     * 列出推送渠道列表
     *
     * @param pushChannelQuery
     * @return
     */
    List<PushChannelList> listPushChannel(PushChannelQuery pushChannelQuery);

    /**
     * 更新推送渠道
     *
     * @param pushChannelQuery
     * @return
     */
    int topPushChannel(PushChannelQuery pushChannelQuery);

    /**
     * 删除推送渠道
     *
     * @param pushChannelQuery
     * @return
     */
    int delPushChannel(PushChannelQuery pushChannelQuery);

    /**
     * 修改推送渠道
     *
     * @param pushChannelAdd
     * @return
     */
    int modPushChannel(PushChannelAdd pushChannelAdd);

    /**
     * 查询渠道详情
     *
     * @param pushChannelId
     * @return
     */
    PushChannelList queryChannelDetail(Long pushChannelId);

    /**
     * 先查询置顶渠道
     *
     * @return
     */
    List<PushChannelList> queryTopChannel(PushChannelQuery pushChannelQuery);

    List<PushChannelList> listPushChannelNoTop(PushChannelQuery pushChannelQuery);

    /**
     * 更具id集合获取渠道信息
     *
     * @param channelIds
     * @return
     */
    List<PushChannelInfo> listChannelById(List<Integer> channelIds);

    /**
     * 获取所有的channel
     *
     * @return
     */
    List<PushChannelInfo> listAllChannel();

    /**
     * 通过channelId 查询渠道信息
     *
     * @param channelId id
     * @return 渠道
     */
    PushChannelInfo queryPushChannelInfoByChannelId(Integer channelId);

    Integer updateChannelOffMsg(Integer pushChannelId, Integer offMsg);

    /**
     * 启用/禁用
     *
     * @param pushChannelQuery
     * @return
     */
    int updateStatus(PushChannelQuery pushChannelQuery);


    int queryChannelBychatId(String chatId);

    /**
     * 根据编码查询
     *
     * @param channelCode 渠道编码
     * @return
     */
    List<PushChannelList> queryByChannelCode(String channelCode);

    /**
     * 根据渠道账户名称查询
     *
     * @param description 账户名称查询
     * @return
     */
    List<PushChannelList> queryByChannelName(String description);

    /**
     * 根据编码查询
     * @param pushChannelAdd
     * @return
     */
    int selectByCode(PushChannelAdd pushChannelAdd);

    /**
     * 根据发送任务id获取渠道信息
     *
     * @param msgSourceId
     * @return
     */
    List<PushChannelInfo> getPushChannelByMsgSourceId(Long msgSourceId);
}
